package com.cbd.pojo;

import java.io.Serializable;
import java.util.*;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;


import org.hibernate.validator.constraints.Length;
import org.hibernate.validator.constraints.NotEmpty;
import org.springframework.validation.annotation.Validated;

import com.fasterxml.jackson.annotation.JsonBackReference;
import com.fasterxml.jackson.annotation.JsonIdentityReference;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonUnwrapped;




/**
 * 合同 企业提供车位给CBD平台
 * 
 */
@Entity
@Table(name="cbdpact")
@Validated
public class Cbdpact implements Serializable{
	@Id
	@GeneratedValue(strategy=GenerationType.IDENTITY)
	@Column(name="pactID")
	private int pactID;
	
	/**
	 * 合同编号
	 * 
	 */
	@Column(name="pactNO")
	@NotEmpty(message="不能为空")
	private String pactNO;
	/**
	 * 合同生效日期  年月日 时分秒
	 * 
	 **/
	@Column(name="pactStartTime")
	private Date pactStartTime;
	/**
	 * 合同到期日期  年月日 时分秒
	 * 
	 **/
	@Column(name="pactEndTime")
	private Date pactEndTime;
	/**
	 * 合同照片
	 * 
	 */
	@Column(name="pactPic")
	@NotEmpty(message="不能为空")
	private String pactPic;
	/**
	 * 合同状态 是否解约 0：没有解约 1：解约成功
	 * 
	 */
	 @Column(name="type")
	private boolean type;

	/**
	 * 公司车位
	 */
	 @OneToMany(cascade=CascadeType.ALL,mappedBy="cbdpact")
	private List<Companycarport> companycarport;
	/**
	 * 签约合同公司
	 */
	@ManyToOne(cascade=CascadeType.ALL)
	@JoinColumn(name="companyID")
	private Company company;

	public int getPactID() {
		return pactID;
	}
	public void setPactID(int pactID) {
		this.pactID = pactID;
	}
	public String getPactNO() {
		return pactNO;
	}
	public void setPactNO(String pactNO) {
		this.pactNO = pactNO;
	}
	public Date getPactStartTime() {
		return pactStartTime;
	}
	public void setPactStartTime(Date pactStartTime) {
		this.pactStartTime = pactStartTime;
	}
	public Date getPactEndTime() {
		return pactEndTime;
	}
	public void setPactEndTime(Date pactEndTime) {
		this.pactEndTime = pactEndTime;
	}
	public String getPactPic() {
		return pactPic;
	}
	public void setPactPic(String pactPic) {
		this.pactPic = pactPic;
	}
	public boolean isType() {
		return type;
	}
	public void setType(boolean type) {
		this.type = type;
	}
	public List<Companycarport> getCompanycarport() {
		return companycarport;
	}
	public void setCompanycarport(List<Companycarport> companycarport) {
		this.companycarport = companycarport;
	}
	public Company getCompany() {
		return company;
	}
	public void setCompany(Company company) {
		this.company = company;
	}


}